#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName  :run_all.py
# @Time      :2021/7/30 14:56
# @author    :Harry

import unittest
from HTMLTestRunner import HTMLTestRunner
# 批量匹配测试用例


discover = unittest.defaultTestLoader.discover(start_dir='../',
                                               pattern='test*.py',
                                               top_level_dir=None)
# 执行用例
# runner = unittest.TextTestRunner()
# runner.run(discover)

with open('../report.html', 'wb+') as f:
    runner = HTMLTestRunner(stream=f,
                            title='自动化测试报告',
                            description='自动化测试报告详情')
    runner.run(discover)
